package random.fox.p2p.ui;

import android.content.Context;
import android.support.v7.widget.Toolbar;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import de.greenrobot.event.EventBus;
import random.fox.p2p.R;
import random.fox.p2p.event.ActionBarEvent;

/**
 * Created by delong on 2015/3/30.
 */
public class SettingView extends LinearLayout {

    @InjectView(R.id.toolbar)
    Toolbar toolbar;

    public SettingView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        ButterKnife.inject(this);

        toolbar.setTitle("用户设置");
        EventBus.getDefault().post(new ActionBarEvent(toolbar, -1, true));
    }

    @OnClick({R.id.setting_user_info, R.id.setting_clear_cache, R.id.setting_update, R.id.setting_user_feed_back, R.id.setting_logout})
    public void tableRowOnClicked(View view) {
        Toast.makeText(getContext(), "id:" + view.getId(), Toast.LENGTH_SHORT).show();
        switch (view.getId()) {
            case R.id.setting_user_info:
                break;
            case R.id.setting_clear_cache:
                break;
            case R.id.setting_update:
                break;
            case R.id.setting_user_feed_back:
                break;
            case R.id.setting_logout:
                break;
        }
    }
}
